package com.nanbei.recursion;

import org.junit.Test;

import java.util.Arrays;

/**
 * @ClassDescription: 单路递归测试
 * @JdkVersion: 17
 * @Author: BaoShan.li
 * @Created: 2023/11/21 14:08
 */
public class SingleRecursionTest {


    @Test
    public void test1(){
        System.out.println(SingleRecursion.jieChen(5));
    }

    @Test
    public void test2(){
        SingleRecursion.reversePrint( "hahahanihao",0);
    }

    @Test
    public void test3(){
        int[] nums = {1, 2, 3, 4, 6, 7, 8, 9};
        int index = SingleRecursion.recursion(nums, 0, nums.length, 10 );
        System.out.println(index);
    }

    @Test
    public void test4(){
        int[] nums = {9, 8, 7, 6, 5, 4, 3, 2, 1};
        SingleRecursion.bubble(nums,nums.length-1);
        System.out.println(Arrays.toString(nums));
    }

    @Test
    public void test5(){
        int[] nums = {1,9, 3, 2, 6, 4, 5, 7, 8};
        SingleRecursion.bubbleUp(nums,nums.length-1);
        System.out.println(Arrays.toString(nums));
    }

    @Test
    public void test6(){
        int[] nums = {1,9, 3, 2, 6, 4, 5, 7, 8};
        SingleRecursion.insertion(nums,1);
        System.out.println(Arrays.toString(nums));
    }

    @Test
    public void test7(){
        int[] ints = new int[5+1];
        ints[1] = 1;
        ints[2] = 2;

        System.out.println(MultiRecursion.fibonacci(5,ints));
    }

}
